function editor() {
    let bgLayer;
    let canvas2 = document.getElementById('_canvas2');
    let ctx2 = canvas2.getContext('2d');
    bgLayer = new Layer(ctx2);
    bgLayer.name = 'bgLayer';
    bgLayer.interval = 5000;
    let bgImg;
    bgLayer.preload = function (loader) {
        bgImg = loader.loadImage('assets/images/Background.jpg');
    }
    bgLayer.create = function () {
        let bg = new BackgroundObject();
        bg.setImage(bgImg);
        bg.fillType = FILL_TYPE_TILE;
        bgLayer.addObject(bg);
    }

    let canvas = document.getElementById("_canvas");
    let ctx = canvas.getContext("2d");
    let engine = new Engine(ctx);
    let layer = new Layer(ctx);

    layer.preload = function (loader) {
    }

    layer.create = function () {
        let coordinate = new CoordinateObject();
        layer.addObject(coordinate);
        let player = new Player(layer);
        player.owner.position = new Position(400, 300);
        player.owner.speed = 50;
    }
    engine.addLayer(bgLayer);
    engine.addLayer(layer);
    engine.run();


    class Player {
        constructor(layer) {
            var _player = new SpriteObject();
            _player.name = 'player';
            this.owner = _player;
            _player.loadImage('assets/images/aaguntopdown.png');
            _player.autoDestory = false;
            _player.addComponent(new GameComponent.MouseDrag()); 
            layer.addObject(_player);
        }
    }

    return engine;
}

